﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data.SqlClient;

namespace TrainingWorkshop.DAL
{
    public class SQLFactory : IFactory
    {
        private SqlConnection sqlconn;
        public SQLFactory()
        {
            this.sqlconn= new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ConnectionString);
        }
        
        public ICourseRepository CourseRepository()
        {
            return new CourseRepository(sqlconn);
        }
        public ITeacherRepository TeacherRepository()
        {
            return new TeacherRepository(sqlconn);
        }
        public ILevelRepository LevelRepository()
        {
            return new LevelRepository(sqlconn);
        }
    }
}
